﻿
@{
    ViewBag.Title = "我的借出";
    Layout = "~/Views/Shared/_LayoutForEUI.cshtml";
    var listColumns = ViewBag.lsitLend as List<SGArchiveSystem7x.Models.CColumnsModel>;
}
<table id="Lend_Index_grid" class="easyui-datagrid" style="width:100%;" title="我的借出" data-options="
       rownumbers:true,
       singleSelect:false,
       autoRowHeight:false,
       pagination:true,
       fitColumns:true,
       fit:true,
       striped:true,
       checkOnSelect:false,
       selectOnCheck:false,
       collapsible:false,
       pageSize: @SGArchiveSystem7x.Models.CCommonsModels.PageSize,
       pageList:[10,15,20]">
    <thead frozen="true">
        <tr>
            @{foreach (var c in listColumns)
                {
                    if (c.Frozen)
                    {
                        <th field="@c.FieldValue" width="@c.Len" align="center" formatter="@c.Formate">@c.FieldText</th>
                    }

                }
            }
        </tr>
    </thead>
    <thead>
        <tr>
            @{foreach (var c in listColumns)
                {
                    if (!c.Frozen)
                    {
                        <th field="@c.FieldValue" width="@c.Len" align="center" formatter="@c.Formate">@c.FieldText</th>
                    }

                }
            }
        </tr>
    </thead>
</table>

<script>

    $(function () {
        $('#Lend_Index_grid').datagrid({
            url: '/Lend/Get_ajaxLendList',
            method: 'post'
        })
    })

    //是否逾期
    function formatOverdue() { }

    function formatResult(value, row) {
        if (value == '0')
            return "<span style='color:Green'>未审批</span>";
        else
            return "<span style='color:blue'>通过</span>"
    }
    function formatStatus(value, row) {
        if (value == '0')
            return "<span style='color:red'>已结束</span>";
        else
            return "<span style='color:blue'>申请</span>"
    }

    function formatDate(value, row) {
        if (value != null) {
            var time = new Date(parseInt(value.substr(6, 19)))
            return time.getFullYear() + "-" + (time.getMonth() + 1) + "-" + time.getDate() + " " + time.getHours() + ":" + time.getMinutes() + ":" + time.getSeconds();
        }
        else {
            return "";
        }
    }
</script>


